<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery.js"></script>
</head>
<body>

    <h2>核酸检测系统</h2>
    <form action="/get" method="get">
        <select name="hospitalId">
            <option value="">--请选择--</option>
            <option th:each="h:${hosp}" th:attr="value=${h.id}" th:text="${h.name}"></option>
        </select>
        <input type="submit" value="查询">
        <input type="button" value="添加" onclick="location.href='/hosp'">
    </form>

<table border="1">
    <tr>
        <th>被检测人</th>
        <th>被检测人手机号</th>
        <th>被检测人身份证号</th>
        <th>检测机构</th>
        <th>检测日期</th>
        <th>检测结果</th>
        <th>操作</th>
    </tr>
    <tr th:each="m:${med}">
        <td th:text="${m.assayUser}"></td>
        <td th:text="${m.phone}"></td>
        <td th:text="${m.cardNum}"></td>
        <td th:text="${m.name}"></td>
        <td th:text="${#dates.format(m.assayTime,'yyyy-MM-dd')}"></td>
        <td th:text="${m.assayResult==0?'检测中':'确诊'}"></td>
        <td><a href="#" onclick="up(this.id)" th:attr="id=${m.id}">确诊</a></td>
    </tr>
</table>
</body>
<script>
    function up(id){
        console.log(id)
        if(confirm("确认确诊吗？")){
            location.href="/up/"+id;
        }
    }
</script>
</html>